import 'package:flutter/material.dart';

class DirectoryList extends StatelessWidget {
  final List<String> directories;
  final String selectedDirectory;
  final Function(String) onDirectorySelected;

  const DirectoryList({
    super.key,
    required this.directories,
    required this.selectedDirectory,
    required this.onDirectorySelected,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.grey[200],
      child: ListView.builder(
        itemCount: directories.length,
        itemBuilder: (context, index) {
          final directory = directories[index];
          return ListTile(
            title: Text(directory),
            selected: directory == selectedDirectory,
            onTap: () => onDirectorySelected(directory),
          );
        },
      ),
    );
  }
}